from Project1.db.DbUtil import *
from Project1.service.PersonManagerService import *

if __name__ == '__main__':

    dbutil = DbUtil()
    dbutil.createTable()



    # 查询用户
    # showPersons()
    # showUsers()

    # deletePerson(5)
    # showPersons()

    personManagerService = PersonManagerService()

    personManagerService.add_person('zhangsan', 24, 'mailfendou@163.com')
    personManagerService.add_person('lisi', 25, 'mailfendou@163.com')
    personManagerService.add_person('wangwu', 26, 'mailfendou@163.com')
    personManagerService.add_person('zhaoliu', 27, 'mailfendou@163.com')

    personManagerService.show_persons()

    # 使用示例
    # engine = create_engine('sqlite:///example.db')
    # person_manager_service = PersonManagerService(engine)
    # person_manager_service.add_person('John Doe', 24, 'john@example.com')
    # person_manager_service.update_person(1, 'Jane Doe', 25, 'jane@example.com')
    # person_manager_service.delete_person(1)
    # person_manager_service.show_persons()